<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1,user-scalable=no">
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        .mycanvas{
            /*border: 1px solid black;*/
            width: 100vw;
            height: 100vh;
            background: cornflowerblue;
        }
    </style>
</head>
<body>
<div class="content_body">
    <canvas class="mycanvas" ></canvas>
    
</div>
<script>
    var mycanvas=document.getElementsByClassName('mycanvas')[0];
    var ctx=mycanvas.getContext('2d');
    var img=new Image();
    img.src="g.jpg";
    img.onload=function () {
        ctx.drawImage(img,0,0,400,150)
    }
</script>

</body>
</html>